Skip to content

Conversation

nikgraf
Copy link
Collaborator

@nikgraf nikgraf commented Feb 4, 2025

  • Moved all the functions inside useCallback
  • Moved lastUpdateClock out of space since it's only needed for the sync internally

This then results in the App provider not rendering anymore when add/update/remove a Todo:

Screenshot 2025-02-04 at 14 27 59

@nikgraf nikgraf self-assigned this Feb 4, 2025
Copy link
Collaborator

@cmwhited cmwhited left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rerenders are the continual bane of my react existence. I try to avoid hooks when I can, but I think this is a good call and we can continue to optimize. I also like the @xstate/react approach to this

@nikgraf nikgraf force-pushed the ng/reduce-rerenders branch from 1e60765 to ce77fa3 Compare February 4, 2025 20:29
@nikgraf nikgraf merged commit 9e88aba into main Feb 4, 2025
4 checks passed
@nikgraf nikgraf deleted the ng/reduce-rerenders branch February 4, 2025 20:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants